home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / src / dutil / expand.c < prev    next >
C/C++ Source or Header  |  1997-09-09  |  782b  |  56 lines

  1. /*
  2.  *    (c)Copyright 1992-1997 Obvious Implementations Corp.  Redistribution and
  3.  *    use is allowed under the terms of the DICE-LICENSE FILE,
  4.  *    DICE-LICENSE.TXT.
  5.  */
  6.  
  7. /*
  8.  *  EXPAND.C
  9.  *
  10.  *  EXPAND [tpl] wildcard
  11.  */
  12.  
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15.  
  16. #include <lib/version.h>
  17.  
  18. #ifdef _DCC
  19. IDENT("expand",".2");
  20. DCOPYRIGHT;
  21. #endif
  22.  
  23.  
  24. main(ac, av)
  25. int   ac;
  26. char *av[];
  27. {
  28.     int   i;
  29.     char  *tpl;
  30.  
  31.     switch(ac) {
  32.     case 1:
  33.     puts("Expand \"fmtstring\" wildcards...");
  34.     puts("Expand %s #?");
  35.     exit(1);
  36.     case 2:
  37.     tpl = "%s";
  38.     break;
  39.     default:
  40.     tpl = av[1];
  41.     ++av;
  42.     --ac;
  43.     }
  44. #ifndef unix
  45.     expand_args(ac, av, &ac, &av);
  46. #endif
  47.  
  48.     for (i = 1; i < ac; ++i) {
  49.     char *p = av[i];
  50.     printf(tpl, p, p, p, p, p, p, p, p, p, p);
  51.     puts("");
  52.     }
  53.     return(0);
  54. }
  55.  
  56.